﻿Public Class frmNhaCC

    Private Function UNhacungcap1_SukienCapNhat(ByVal ma As System.String, ByVal ten As System.String, ByVal dchi As System.String, ByVal no As System.Double) As System.Int32 Handles UNhacungcap1.SukienCapNhat
        Dim flag As Integer = 1
        Dim err As String = String.Empty
        err = BUS.BusNhacc.Capnhat(ma, ten, dchi, no)
        If err <> String.Empty Then
            flag = 0
            MessageBox.Show(err)
        End If
        Return flag
    End Function

    Private Sub UNhacungcap1_SukienLoad() Handles UNhacungcap1.SukienLoad
        Dim bang As DataTable = Nothing
        bang = BUS.BusNhacc.Lay()
        UNhacungcap1.DataSource(bang)
    End Sub

    Private Function UNhacungcap1_SukienThem(ByVal ten As System.String, ByVal dchi As System.String, ByVal no As System.Double) As System.Int32 Handles UNhacungcap1.SukienThem
        Dim flag As Integer = 1
        Dim err As String = String.Empty
        err = BUS.BusNhacc.Them(ten, dchi, no)
        If (err <> String.Empty) Then
            flag = 0
            MessageBox.Show(err)
        End If
        Return flag
    End Function

    Private Function UNhacungcap1_SukienXoa(ByVal ma As System.String) As System.Int32 Handles UNhacungcap1.SukienXoa
        Dim flag As Integer = 1
        Dim err As String = String.Empty
        err = BUS.BusNhacc.Xoa(ma)
        If err <> String.Empty Then
            flag = 0
            MessageBox.Show(err)
        End If
        Return flag
    End Function

    Private Sub frmNhaCC_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        UNhacungcap1_SukienLoad()
    End Sub
End Class